{extend name="base" /}

{block name="title"}我的预约{/block}

{block name="resource"}
<style type="text/css">
	.tis_box p {
		font-size: 14px;
		float: none;
	}
</style>
{/block}

{block name="main"}
<div class="main">
	<div class="container">
		
		<div class="wdyy">
			<div class="tis_box clearfix">
				<p>1.VIP会员：最高可预约 {:getParam('APPOINTMENT_VIP_MONEY_MAX')}元 ~ 最低可预约{:getParam('APPOINTMENT_MONEY_MIN')}元</p>
				<p>2.非VIP会员：最高可预约 {:getParam('APPOINTMENT_MONEY_MAX')}元 ~ 最低可预约{:getParam('APPOINTMENT_VIP_MONEY_MIN')}元</p>
				<p>3.预约到的单子收益更高哦！</p>
			</div>
			<form method="post">
				<input type="hidden" name="__token__" value="{$Request.token}" />
				<div class="">
					<span>预约额度</span>
					<input type="text" name="appointment_money"/>
					<span>元</span>
				</div>
				<div class="btn_box">
					<button class="tx_btn" type="submit">立即预约</button>
				</div>
			</form>
			<div class="yytj_box">
				<p>总预约<span class="color_ceng">{$helpAppointmentLastId}</span>人
				{if condition="isset($help_appointment['help_appointment_id'])"}
					，当前匹配预约<span class="color_ceng">{$currentHelpAppointment}</span>名</p>
				{/if}
				<p>你的预约名次为<span class="color_ceng">{$help_appointment.help_appointment_id??'0'}</span></p>
				<p>当前系统时间：<span class="color_ceng" id="showCurrentTime"></span></p>
			</div>
		</div>

		<div class="qd_box">
			<div class="table_modal">
					
				<div class="tab_title">
					<p>我的预约</p>
				</div>
				
				<div class="qd_table_box">
					<div class="table-responsive">
					  	<table class="table text-center table-bordered">
					    	<tr>
					    		<th>预约ID</th>
					    		<th>预约时间</th>
					    		<th>预约金额</th>
					    		<th>剩余金额</th>
					    		<th>状态</th>
					    		<th>匹配次数</th>
					    		<!--<th>操作</th>-->
					    	</tr>
					    	{notempty name="help_appointment"}
					    	<tr>
					    		<td>{$help_appointment.help_appointment_id}</td>
					    		<td>{$help_appointment.create_time}</td>
					    		<td>{$help_appointment.appointment_money}</td>
					    		<td>{$help_appointment.remaining_money}</td>
					    		<td>{$help_appointment.status}</td>
					    		<td>{$help_appointment.to_num}</td>
					    		<!--<td>
					    			{/*neq name="help_appointment->getData('status')" value="1"*/}
					    				<a href="javascript:cancelAppointment({/*$help_appointment.help_appointment_id*/});">取消预约</a>
					    			{/*/neq*/}
					    		</td>-->
					    	</tr>
					    	{/notempty}
					    	{volist name='helpAppointments' id='helpAppointment'}
							<tr>
								<td>{$helpAppointment.help_appointment_id}</td>
					    		<td>{$helpAppointment.create_time}</td>
					    		<td>{$helpAppointment.appointment_money}</td>
					    		<td>{$helpAppointment.remaining_money}</td>
					    		<td>{$helpAppointment.status}</td>
					    		<td>{$helpAppointment.to_num}</td>
							</tr>
							{/volist}
					  	</table>
					</div>
					<nav>
						{$helpAppointments -> render()}
					</nav>
				</div>
			</div>
		</div>	
	</div>
</div>
{/block}

{block name="script"}
<script type="text/javascript">
	function getLocalTime(nS) {
		return new Date(parseInt(nS) * 1000).toLocaleString().replace(/年|月/g, "-").replace(/日/g, " ");
	}
	var currentTime = {:time()};
	showCurrentTime.innerHTML = getLocalTime(currentTime);
	setInterval(function () {
		showCurrentTime.innerHTML = getLocalTime(currentTime);
		currentTime += 1;
	},1000);
</script>
{/block}